package  com.cnn.base.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import  com.cnn.base.mapper.ResourceMapper;
import  com.cnn.base.model.ResourceExample;
import  com.cnn.base.service.ResourceService;

@Service
public class ResourceServiceImpl implements ResourceService {

	@Resource
	private ResourceMapper resourceMapper;

	@Override
	public void addResource(com.cnn.base.model.Resource resource) {
		resourceMapper.insert(resource);
	}

	@Override
	public void updateResource(com.cnn.base.model.Resource resource) {
		resourceMapper.updateByPrimaryKeySelective(resource);
	}

	@Override
	public void deleteResource(Long id) {
		resourceMapper.deleteByPrimaryKey(id);
	}

	@Override
	public List<com.cnn.base.model.Resource> getResource() {
		return resourceMapper.selectByExample(new ResourceExample());
	}

	@Override
	public com.cnn.base.model.Resource getResourceById(Long id) {
		return resourceMapper.selectByPrimaryKey(id);
	}
}
